const fs = require('fs');

fs.readFile('./files/1.txt', 'utf-8', function(error, data) {
    console.log(error);
    console.log('*********');
    console.log(data);
})

/* 
输出错误信息(error)：
    [Error: ENOENT: no such file or directory, open 'E:\htmlspace\nodejs\day01\1\1.txt'] {
    errno: -4058,
    code: 'ENOENT',
    syscall: 'open',
    path: 'E:\\htmlspace\\nodejs\\day01\\1\\1.txt'
    }
*/
fs.readFile('/files/1.txt', 'utf-8', function(error, data) {
    console.log(error);
    console.log('*********');
    console.log(data);
})